package com.marketingexpert.service.storemgnt;

import java.util.Date;
import java.util.List;
import java.util.Map;

import net.sf.json.JSONArray;

import com.marketingexpert.exception.MarketingExpertException;
import com.taobao.api.ApiException;
import com.taobao.api.domain.Activity;
import com.taobao.api.domain.Coupon;
import com.taobao.api.domain.Item;
import com.taobao.api.domain.ItemCat;
import com.taobao.api.domain.ItemSearch;
import com.taobao.api.domain.Meal;
import com.taobao.api.domain.SellerCat;
import com.taobao.api.domain.Shop;

public interface StoreService {

	/**
	 * 获取登录后的用户信息
	 * @param sessionKey
	 * @return
	 * @throws ApiException
	 */
	public Object getUser(String sessionKey) throws MarketingExpertException;

	public Shop getUserShop(String nick) throws MarketingExpertException;

	public String getAuthUrl();

	/**
	 * ��ȡ��̨�����ҷ�����Ʒ�ı�׼��Ʒ��Ŀ
	 * 
	 * @return
	 * @throws ApiException
	 */
	public List<ItemCat> getItemCategory() throws MarketingExpertException;

	/**
	 * ��ȡ��ǰ�û����ڳ����е���Ʒ�б�
	 * 
	 * @param ҳ���ʶ
	 * @param �û�sessionKey
	 * @return
	 * @throws MarketingExpertException
	 */
	public List<Item> getItemOnSale(long pageNo, String sessionKey)
			throws MarketingExpertException;

	/**
	 * ������ȡ��Ʒ��Ϣ
	 * 
	 * @param iid
	 * @param sessionKey
	 * @return
	 * @throws MarketingExpertException
	 */
	public List<Item> getItem(String[] iids, String sessionKey)
			throws MarketingExpertException;

	/**
	 * ������ѯ�
	 * @param activityIds
	 * @param sessionKey
	 * @return
	 */
	public List<AbstractActivity> getCouponActivity(String activityIds, String sessionKey)throws MarketingExpertException;
	
	/**
	 * ������ѯ�Żݾ�
	 * @param couponIds
	 * @param sessionKey
	 * @return
	 * @throws MarketingExpertException
	 */
	public List<Coupon> batchQueryCoupon(long[] couponIds, String sessionKey) throws MarketingExpertException;
	
	/**
	 * ��ȡ������Ʒ,�����Ʒid
	 * 
	 * @param itemId
	 * @param sessionKey
	 * @return
	 * @throws MarketingExpertException
	 */
	public Item getSingleItem(long itemId, String sessionKey)
			throws MarketingExpertException;

	/**
	 * ������Ʒ�۸�
	 * 
	 * @param itemId
	 * @param minusRMB
	 */
	public void updateItemPrice(String itemId, double minusRMB,
			String sessionKey) throws MarketingExpertException;

	/**
	 * ��ȡ�����Զ�����Ŀ
	 * 
	 * @param sessionKey
	 * @return
	 * @throws MarketingExpertException
	 */
	public List<SellerCat> getSellercatsList(String sessionKey, String nick)
			throws MarketingExpertException;

	/**
	 * ��Ʒ����
	 * 
	 * @param cid
	 * @param title
	 * @param catId 
	 * @param itemId
	 * @param lowPrice
	 * @param topPrice
	 * @return
	 */
	public Map<String, Object> searchItem(String nick, long pageNo, long pageSize, Map<String, String> parames) throws MarketingExpertException;

	/**
	 * ��ȡ�������е��Żݾ�
	 * @param sessionKey
	 * @return
	 * @throws MarketingExpertException
	 */	
	public List<Coupon> getExistCoupon(String sessionKey,long pageNo, long couponId) 	throws MarketingExpertException ;

	/**
	 * ��ȡ���ܻ������Ʒ
	 * @param matchStr
	 * @return
	 */
	public JSONArray getNewItemAsJson(long pageNo,String sessionKey);


	/**
	 * �Զ��Ƽ���������Ʒ
	 * @param sessionKey
	 * @param today
	 */
	public  List<Item> searchNewItem(String sessionKey, String today)  throws MarketingExpertException;
	
	/**
	 * ���id��ѯ�����Ѿ������Ļ
	 * @param activityId
	 * @param sessionKey
	 */
	public List<Activity> getActivity(String activityId, String sessionKey)  throws MarketingExpertException;
	
	/**
	 * ��ѯ�����Ѿ������Ļ
	 * @param activityId
	 * @param sessionKey
	 */
	public JSONArray getActivityAsJson(String activityId, String sessionKey)  throws MarketingExpertException;

	/**
	 * ��ȡһ����Ʒ���Ż�
	 * @param itemId
	 * @param sessionKey
	 * @param pageNo 
	 * @return
	 */
	public MarketingPromotion getItemPromotion(String itemId, String sessionKey, long pageNo);

	/**
	 * ��ѯ���������ײ�
	 * @param mealId
	 * @param sessionKey
	 * @return
	 */
	public List<Meal> queryMeals(long mealId, String sessionKey);

	public Date getTBServerTime();

	/**
	 * ��ȡǰ̨չʾ�ĵ�����Ŀ
	 * @return
	 */
	//public List<ItemCat> getShopCategory();

}
